<?php
session_start();
$title = $_SESSION['title'];
$category=$_SESSION['category'];
$productid=$_SESSION['productid'];

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>user details</title>
</head>

<body>

<?php
		  			$host="localhost";
                    $dbusername="root";
                    $dbpassword="";
                    $database="books";
                    $x=mysql_connect($host,$dbusername,$dbpassword);
                    $x2=mysql_select_db($database);
					
					$query = "select * from products where productid='". $productid ."' or title='". $title ."' and category ='". $category ."'";
                    $rs=mysql_query($query);
					
			if($rs)
					 {
					  $i=0;
					  while($rs_data=mysql_fetch_array($rs))
					  {
					  $i++;
					   $_SESSION['session_productid']=$rs_data["productid"];
					   $_SESSION['session_title']=$rs_data["title"];
					   $_SESSION['session_author']=$rs_data["author"];
					   $_SESSION['session_description']=$rs_data["description"];
					   $_SESSION['session_price']=$rs_data["price"];
					   $_SESSION['session_category']=$rs_data["category"];
					   $_SESSION['session_date']=$rs_data["date"];
					    $_SESSION['session_imageurl']=$rs_data["imageurl"];
					   }
					   if($i>0){
						header("location:book_find_edit.php");
						}
						else{
					
						header("location:book_edit.php?act=norecord");
						}
					}
					else
					{
					die("login failed..................");
					} 
					?>
</body>
</html>